package net.pws.oos.biz.query.impl;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import net.pws.common.persistence.IPage;
import net.pws.common.persistence.Page;
import net.pws.oos.biz.model.Station;
import net.pws.oos.biz.model.StationRecord;
import net.pws.oos.biz.query.StationFinder;
import net.pws.oos.biz.query.parameter.StationQueryParameter;

import org.apache.commons.lang.StringUtils;
import org.hibernate.Hibernate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@SuppressWarnings({ "rawtypes", "unchecked" })
public class DefaultStationFinder extends AbstractFinder implements
		StationFinder {

	@Transactional
	public IPage<Map> getStationList(StationQueryParameter queryParameter,
			int start, int limit) {
		// StringBuilder hql = new StringBuilder(QueryRepository.getInstance()
		// .get("hql.listStation"));
		// hql.append(" where 1=1 ");
		StringBuilder hql = new StringBuilder(
				"select t from Station t where 1=1");

		List<Object> params = new ArrayList<Object>();
		buildStationQueryRequest(queryParameter, hql, params);

		// 排序
		hql.append(" order by t.createDateTime desc");

		IPage<Station> page = entityManager.findPage(hql.toString(),
				params.toArray(), start, limit);
		List<Map> data = new ArrayList<Map>();
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		for (Station station : page.getData()) {
			Map<String, Object> map = buildResult(station);
			data.add(map);
		}
		return new Page(page.getCurrentPageNo(), page.getTotalDataCount(),
				page.getDataCountInOnePage(), data);
	}

	/**
	 * Station alias t User alias u
	 * 
	 * @param queryParameter
	 * @param hql
	 * @param params
	 */
	private void buildStationQueryRequest(StationQueryParameter queryParameter,
			StringBuilder hql, List<Object> params) {
		if (queryParameter == null) {
			return;
		}

		// 编码
		if (StringUtils.isNotBlank(queryParameter.getCode())) {
			hql.append(" and t.code=? ");
			params.add(queryParameter.getCode());
		}
		// 名称
		if (StringUtils.isNotBlank(queryParameter.getName())) {
			hql.append(" and t.name like ? ");
			params.add('%' + queryParameter.getName() + '%');
		}
		// 工程建设模式
		if (StringUtils.isNotBlank(queryParameter.getConstructionModelId())) {
			hql.append(" and t.constructionModel.id = ? ");
			params.add('%' + queryParameter.getName() + '%');
		}
		// 地州
		if (StringUtils.isNotBlank(queryParameter.getAreaId())) {
			hql.append(" and t.area.id = ? ");
			params.add(queryParameter.getAreaId());
		}
		// 区县
		if (StringUtils.isNotBlank(queryParameter.getCountyId())) {
			hql.append(" and t.county.id = ? ");
			params.add(queryParameter.getCountyId());
		}
	}

	@Transactional
	private Map buildResult(Station station) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("code", station.getCode());
		map.put("name", station.getName());
		map.put("description", station.getDescription());
		StationRecord stationRecord = station.getStationRecord();
		if (null != stationRecord) {
			if (!Hibernate.isInitialized(stationRecord)) {
				Hibernate.initialize(stationRecord);
			}
			map.put("stationRecordId", stationRecord.getId());
		} else {
			map.put("stationRecordId", null);
			map.put("stationRecordName", null);
		}
		if (null != station.getCreator()) {
			if (!Hibernate.isInitialized(station.getCreator())) {
				Hibernate.initialize(station.getCreator());
			}
			map.put("creatorId", station.getCreator().getId());
			map.put("creatorName", station.getCreator().getName());
		} else {
			map.put("creatorId", null);
			map.put("creatorName", null);
		}
		map.put("createDateTime", station.getCreateDateTime());
		map.put("deleted", station.getDeleted());
		if (null != station.getDeletor()) {
			if (!Hibernate.isInitialized(station.getDeletor())) {
				Hibernate.initialize(station.getDeletor());
			}
			map.put("deletorId", station.getDeletor().getId());
			map.put("deletorName", station.getDeletor().getName());
		} else {
			map.put("deletorId", null);
			map.put("deletorName", null);
		}
		map.put("deleteDateTime", station.getDeleteDateTime());
		map.put("projectPeriods", station.getProjectPeriods());
		if (null != station.getArea()) {
			if (!Hibernate.isInitialized(station.getArea())) {
				Hibernate.initialize(station.getArea());
			}
			map.put("areaId", station.getArea().getId());
			map.put("areaName", station.getArea().getName());
		} else {
			map.put("areaId", null);
			map.put("areaName", null);
		}
		if (null != station.getCounty()) {
			if (!Hibernate.isInitialized(station.getCounty())) {
				Hibernate.initialize(station.getCounty());
			}
			map.put("countyId", station.getCounty().getId());
			map.put("countyName", station.getCounty().getName());
		} else {
			map.put("countyId", null);
			map.put("countyName", null);
		}
		map.put("towns", station.getTowns());
		if (null != station.getStationType()) {
			if (!Hibernate.isInitialized(station.getStationType())) {
				Hibernate.initialize(station.getStationType());
			}
			map.put("stationTypeId", station.getStationType().getId());
			map.put("stationTypeName", station.getStationType().getName());
		} else {
			map.put("stationTypeId", null);
			map.put("stationTypeName", null);
		}
		map.put("baseStationName", station.getBaseStationName());
		map.put("baseStationCode", station.getBaseStationCode());
		map.put("mainSeparation", station.getMainSeparation());
		map.put("baseStationSite", station.getBaseStationSite());
		map.put("altitude", station.getAltitude());
		map.put("relativeHeight", station.getRelativeHeight());
		map.put("secondMoveDistance", station.getSecondMoveDistance());
		if (null != station.getSiteProperties()) {
			if (!Hibernate.isInitialized(station.getSiteProperties())) {
				Hibernate.initialize(station.getSiteProperties());
			}
			map.put("sitePropertiesId", station.getSiteProperties().getId());
			map.put("sitePropertiesName", station.getSiteProperties().getName());
		} else {
			map.put("sitePropertiesId", null);
			map.put("sitePropertiesName", null);
		}
		if (null != station.getPropertyOwnership()) {
			if (!Hibernate.isInitialized(station.getPropertyOwnership())) {
				Hibernate.initialize(station.getPropertyOwnership());
			}
			map.put("propertyOwnershipId", station.getPropertyOwnership()
					.getId());
			map.put("propertyOwnershipName", station.getPropertyOwnership()
					.getName());
		} else {
			map.put("propertyOwnershipId", null);
			map.put("propertyOwnershipName", null);
		}
		if (null != station.getAreaType()) {
			if (!Hibernate.isInitialized(station.getAreaType())) {
				Hibernate.initialize(station.getAreaType());
			}
			map.put("areaTypeId", station.getAreaType().getId());
			map.put("areaTypeName", station.getAreaType().getName());
		} else {
			map.put("areaTypeId", null);
			map.put("areaTypeName", null);
		}
		map.put("coveringTarget", station.getCoveringTarget());
		if (null != station.getConstructionModel()) {
			if (!Hibernate.isInitialized(station.getConstructionModel())) {
				Hibernate.initialize(station.getConstructionModel());
			}
			map.put("constructionModelId", station.getConstructionModel()
					.getId());
			map.put("constructionModelName", station.getConstructionModel()
					.getName());
		} else {
			map.put("constructionModelId", null);
			map.put("constructionModelName", null);
		}
		if (null != station.getSiteValid()) {
			if (!Hibernate.isInitialized(station.getSiteValid())) {
				Hibernate.initialize(station.getSiteValid());
			}
			map.put("siteValidId", station.getSiteValid().getId());
			map.put("siteValidName", station.getSiteValid().getName());
		} else {
			map.put("siteValidId", null);
			map.put("siteValidName", null);
		}
		map.put("siteValidReason", station.getSiteValidReason());

		if (null != stationRecord.getCprimaryDevice01()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice01());
			}
			map.put("cprimaryDevice01Id", stationRecord.getCprimaryDevice01()
					.getId());
			map.put("cprimaryDevice01Name", stationRecord.getCprimaryDevice01()
					.getName());
		} else {
			map.put("cprimaryDevice01Id", null);
			map.put("cprimaryDevice01Name", null);
		}
		if (null != stationRecord.getCprimaryDevice02()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice02());
			}
			map.put("cprimaryDevice02Id", stationRecord.getCprimaryDevice02()
					.getId());
			map.put("cprimaryDevice02Name", stationRecord.getCprimaryDevice02()
					.getName());
		} else {
			map.put("cprimaryDevice02Id", null);
			map.put("cprimaryDevice02Name", null);
		}
		if (null != stationRecord.getCprimaryDevice03()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice03())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice03());
			}
			map.put("cprimaryDevice03Id", stationRecord.getCprimaryDevice03()
					.getId());
			map.put("cprimaryDevice03Name", stationRecord.getCprimaryDevice03()
					.getName());
		} else {
			map.put("cprimaryDevice03Id", null);
			map.put("cprimaryDevice03Name", null);
		}
		if (null != stationRecord.getCprimaryDevice04()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice04());
			}
			map.put("cprimaryDevice04Id", stationRecord.getCprimaryDevice04()
					.getId());
			map.put("cprimaryDevice04Name", stationRecord.getCprimaryDevice04()
					.getName());
		} else {
			map.put("cprimaryDevice04Id", null);
			map.put("cprimaryDevice04Name", null);
		}
		if (null != stationRecord.getCprimaryDevice05()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice05());
			}
			map.put("cprimaryDevice05Id", stationRecord.getCprimaryDevice05()
					.getId());
			map.put("cprimaryDevice05Name", stationRecord.getCprimaryDevice05()
					.getName());
		} else {
			map.put("cprimaryDevice05Id", null);
			map.put("cprimaryDevice05Name", null);
		}
		if (null != stationRecord.getCprimaryDevice06()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice06());
			}
			map.put("cprimaryDevice06Id", stationRecord.getCprimaryDevice06()
					.getId());
			map.put("cprimaryDevice06Name", stationRecord.getCprimaryDevice06()
					.getName());
		} else {
			map.put("cprimaryDevice06Id", null);
			map.put("cprimaryDevice06Name", null);
		}
		if (null != stationRecord.getCprimaryDevice07()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice07())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice07());
			}
			map.put("cprimaryDevice07Id", stationRecord.getCprimaryDevice07()
					.getId());
			map.put("cprimaryDevice07Name", stationRecord.getCprimaryDevice07()
					.getName());
		} else {
			map.put("cprimaryDevice07Id", null);
			map.put("cprimaryDevice07Name", null);
		}
		if (null != stationRecord.getCprimaryDevice08()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice08())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice08());
			}
			map.put("cprimaryDevice08Id", stationRecord.getCprimaryDevice08()
					.getId());
			map.put("cprimaryDevice08Name", stationRecord.getCprimaryDevice08()
					.getName());
		} else {
			map.put("cprimaryDevice08Id", null);
			map.put("cprimaryDevice08Name", null);
		}
		if (null != stationRecord.getCprimaryDevice09()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice09())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice09());
			}
			map.put("cprimaryDevice09Id", stationRecord.getCprimaryDevice09()
					.getId());
			map.put("cprimaryDevice09Name", stationRecord.getCprimaryDevice09()
					.getName());
		} else {
			map.put("cprimaryDevice09Id", null);
			map.put("cprimaryDevice09Name", null);
		}
		map.put("cprimaryDevice10", stationRecord.getCprimaryDevice10());
		map.put("cprimaryDevice11", stationRecord.getCprimaryDevice11());
		map.put("cprimaryDevice12", stationRecord.getCprimaryDevice12());
		if (null != stationRecord.getCprimaryDevice13()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice13());
			}
			map.put("cprimaryDevice13Id", stationRecord.getCprimaryDevice13()
					.getId());
			map.put("cprimaryDevice13Name", stationRecord.getCprimaryDevice13()
					.getName());
		} else {
			map.put("cprimaryDevice13Id", null);
			map.put("cprimaryDevice13Name", null);
		}
		map.put("cprimaryDevice14", stationRecord.getCprimaryDevice14());
		map.put("cprimaryDevice15", stationRecord.getCprimaryDevice15());
		map.put("cprimaryDevice16", stationRecord.getCprimaryDevice16());
		if (null != stationRecord.getCprimaryDevice17()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice17());
			}
			map.put("cprimaryDevice17Id", stationRecord.getCprimaryDevice17()
					.getId());
			map.put("cprimaryDevice17Name", stationRecord.getCprimaryDevice17()
					.getName());
		} else {
			map.put("cprimaryDevice17Id", null);
			map.put("cprimaryDevice17Name", null);
		}
		if (null != stationRecord.getCprimaryDevice18()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice18())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice18());
			}
			map.put("cprimaryDevice18Id", stationRecord.getCprimaryDevice18()
					.getId());
			map.put("cprimaryDevice18Name", stationRecord.getCprimaryDevice18()
					.getName());
		} else {
			map.put("cprimaryDevice18Id", null);
			map.put("cprimaryDevice18Name", null);
		}
		if (null != stationRecord.getCprimaryDevice19()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice19())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice19());
			}
			map.put("cprimaryDevice19Id", stationRecord.getCprimaryDevice19()
					.getId());
			map.put("cprimaryDevice19Name", stationRecord.getCprimaryDevice19()
					.getName());
		} else {
			map.put("cprimaryDevice19Id", null);
			map.put("cprimaryDevice19Name", null);
		}
		if (null != stationRecord.getCprimaryDevice20()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice20())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice20());
			}
			map.put("cprimaryDevice20Id", stationRecord.getCprimaryDevice20()
					.getId());
			map.put("cprimaryDevice20Name", stationRecord.getCprimaryDevice20()
					.getName());
		} else {
			map.put("cprimaryDevice20Id", null);
			map.put("cprimaryDevice20Name", null);
		}
		if (null != stationRecord.getCprimaryDevice21()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice21())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice21());
			}
			map.put("cprimaryDevice21Id", stationRecord.getCprimaryDevice21()
					.getId());
			map.put("cprimaryDevice21Name", stationRecord.getCprimaryDevice21()
					.getName());
		} else {
			map.put("cprimaryDevice21Id", null);
			map.put("cprimaryDevice21Name", null);
		}
		if (null != stationRecord.getCprimaryDevice22()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice22())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice22());
			}
			map.put("cprimaryDevice22Id", stationRecord.getCprimaryDevice22()
					.getId());
			map.put("cprimaryDevice22Name", stationRecord.getCprimaryDevice22()
					.getName());
		} else {
			map.put("cprimaryDevice22Id", null);
			map.put("cprimaryDevice22Name", null);
		}
		map.put("cprimaryDevice23", stationRecord.getCprimaryDevice23());
		map.put("cprimaryDevice24", stationRecord.getCprimaryDevice24());
		map.put("cprimaryDevice25", stationRecord.getCprimaryDevice25());
		if (null != stationRecord.getCprimaryDevice26()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice26());
			}
			map.put("cprimaryDevice26Id", stationRecord.getCprimaryDevice26()
					.getId());
			map.put("cprimaryDevice26Name", stationRecord.getCprimaryDevice26()
					.getName());
		} else {
			map.put("cprimaryDevice26Id", null);
			map.put("cprimaryDevice26Name", null);
		}
		map.put("cprimaryDevice27", stationRecord.getCprimaryDevice27());
		map.put("cprimaryDevice28", stationRecord.getCprimaryDevice28());
		map.put("cprimaryDevice29", stationRecord.getCprimaryDevice29());
		map.put("cprimaryDevice30", stationRecord.getCprimaryDevice30());
		if (null != stationRecord.getCprimaryDevice31()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice31())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice31());
			}
			map.put("cprimaryDevice31Id", stationRecord.getCprimaryDevice31()
					.getId());
			map.put("cprimaryDevice31Name", stationRecord.getCprimaryDevice31()
					.getName());
		} else {
			map.put("cprimaryDevice31Id", null);
			map.put("cprimaryDevice31Name", null);
		}
		if (null != stationRecord.getCprimaryDevice32()) {
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice32())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice32());
			}
			map.put("cprimaryDevice32Id", stationRecord.getCprimaryDevice32()
					.getId());
			map.put("cprimaryDevice32Name", stationRecord.getCprimaryDevice32()
					.getName());
		} else {
			map.put("cprimaryDevice32Id", null);
			map.put("cprimaryDevice32Name", null);
		}
		map.put("cprimaryDevice33", stationRecord.getCprimaryDevice33());
		if (null != stationRecord.getLtefddprimaryDevice01()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice01());
			}
			map.put("ltefddprimaryDevice01Id", stationRecord
					.getLtefddprimaryDevice01().getId());
			map.put("ltefddprimaryDevice01Name", stationRecord
					.getLtefddprimaryDevice01().getName());
		} else {
			map.put("ltefddprimaryDevice01Id", null);
			map.put("ltefddprimaryDevice01Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice02()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice02());
			}
			map.put("ltefddprimaryDevice02Id", stationRecord
					.getLtefddprimaryDevice02().getId());
			map.put("ltefddprimaryDevice02Name", stationRecord
					.getLtefddprimaryDevice02().getName());
		} else {
			map.put("ltefddprimaryDevice02Id", null);
			map.put("ltefddprimaryDevice02Name", null);
		}
		map.put("ltefddprimaryDevice03",
				stationRecord.getLtefddprimaryDevice03());
		if (null != stationRecord.getLtefddprimaryDevice04()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice04());
			}
			map.put("ltefddprimaryDevice04Id", stationRecord
					.getLtefddprimaryDevice04().getId());
			map.put("ltefddprimaryDevice04Name", stationRecord
					.getLtefddprimaryDevice04().getName());
		} else {
			map.put("ltefddprimaryDevice04Id", null);
			map.put("ltefddprimaryDevice04Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice05()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice05());
			}
			map.put("ltefddprimaryDevice05Id", stationRecord
					.getLtefddprimaryDevice05().getId());
			map.put("ltefddprimaryDevice05Name", stationRecord
					.getLtefddprimaryDevice05().getName());
		} else {
			map.put("ltefddprimaryDevice05Id", null);
			map.put("ltefddprimaryDevice05Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice06()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice06());
			}
			map.put("ltefddprimaryDevice06Id", stationRecord
					.getLtefddprimaryDevice06().getId());
			map.put("ltefddprimaryDevice06Name", stationRecord
					.getLtefddprimaryDevice06().getName());
		} else {
			map.put("ltefddprimaryDevice06Id", null);
			map.put("ltefddprimaryDevice06Name", null);
		}
		map.put("ltefddprimaryDevice07",
				stationRecord.getLtefddprimaryDevice07());
		map.put("ltefddprimaryDevice08",
				stationRecord.getLtefddprimaryDevice08());
		map.put("ltefddprimaryDevice09",
				stationRecord.getLtefddprimaryDevice09());
		map.put("ltefddprimaryDevice10",
				stationRecord.getLtefddprimaryDevice10());
		map.put("ltefddprimaryDevice11",
				stationRecord.getLtefddprimaryDevice11());
		map.put("ltefddprimaryDevice12",
				stationRecord.getLtefddprimaryDevice12());
		if (null != stationRecord.getLtefddprimaryDevice13()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice13());
			}
			map.put("ltefddprimaryDevice13Id", stationRecord
					.getLtefddprimaryDevice13().getId());
			map.put("ltefddprimaryDevice13Name", stationRecord
					.getLtefddprimaryDevice13().getName());
		} else {
			map.put("ltefddprimaryDevice13Id", null);
			map.put("ltefddprimaryDevice13Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice14()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice14())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice14());
			}
			map.put("ltefddprimaryDevice14Id", stationRecord
					.getLtefddprimaryDevice14().getId());
			map.put("ltefddprimaryDevice14Name", stationRecord
					.getLtefddprimaryDevice14().getName());
		} else {
			map.put("ltefddprimaryDevice14Id", null);
			map.put("ltefddprimaryDevice14Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice15()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice15())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice15());
			}
			map.put("ltefddprimaryDevice15Id", stationRecord
					.getLtefddprimaryDevice15().getId());
			map.put("ltefddprimaryDevice15Name", stationRecord
					.getLtefddprimaryDevice15().getName());
		} else {
			map.put("ltefddprimaryDevice15Id", null);
			map.put("ltefddprimaryDevice15Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice16()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice16())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice16());
			}
			map.put("ltefddprimaryDevice16Id", stationRecord
					.getLtefddprimaryDevice16().getId());
			map.put("ltefddprimaryDevice16Name", stationRecord
					.getLtefddprimaryDevice16().getName());
		} else {
			map.put("ltefddprimaryDevice16Id", null);
			map.put("ltefddprimaryDevice16Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice17()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice17());
			}
			map.put("ltefddprimaryDevice17Id", stationRecord
					.getLtefddprimaryDevice17().getId());
			map.put("ltefddprimaryDevice17Name", stationRecord
					.getLtefddprimaryDevice17().getName());
		} else {
			map.put("ltefddprimaryDevice17Id", null);
			map.put("ltefddprimaryDevice17Name", null);
		}
		map.put("ltefddprimaryDevice18",
				stationRecord.getLtefddprimaryDevice18());
		map.put("ltefddprimaryDevice19",
				stationRecord.getLtefddprimaryDevice19());
		map.put("ltefddprimaryDevice20",
				stationRecord.getLtefddprimaryDevice20());
		map.put("ltefddprimaryDevice21",
				stationRecord.getLtefddprimaryDevice21());
		map.put("ltefddprimaryDevice22",
				stationRecord.getLtefddprimaryDevice22());
		if (null != stationRecord.getLtefddprimaryDevice23()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice23())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice23());
			}
			map.put("ltefddprimaryDevice23Id", stationRecord
					.getLtefddprimaryDevice23().getId());
			map.put("ltefddprimaryDevice23Name", stationRecord
					.getLtefddprimaryDevice23().getName());
		} else {
			map.put("ltefddprimaryDevice23Id", null);
			map.put("ltefddprimaryDevice23Name", null);
		}
		map.put("ltefddprimaryDevice24",
				stationRecord.getLtefddprimaryDevice24());
		if (null != stationRecord.getLtefddprimaryDevice25()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice25())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice25());
			}
			map.put("ltefddprimaryDevice25Id", stationRecord
					.getLtefddprimaryDevice25().getId());
			map.put("ltefddprimaryDevice25Name", stationRecord
					.getLtefddprimaryDevice25().getName());
		} else {
			map.put("ltefddprimaryDevice25Id", null);
			map.put("ltefddprimaryDevice25Name", null);
		}
		if (null != stationRecord.getLtefddprimaryDevice26()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice26());
			}
			map.put("ltefddprimaryDevice26Id", stationRecord
					.getLtefddprimaryDevice26().getId());
			map.put("ltefddprimaryDevice26Name", stationRecord
					.getLtefddprimaryDevice26().getName());
		} else {
			map.put("ltefddprimaryDevice26Id", null);
			map.put("ltefddprimaryDevice26Name", null);
		}
		map.put("ltefddprimaryDevice27",
				stationRecord.getLtefddprimaryDevice27());
		if (null != stationRecord.getLtetddprimaryDevice01()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice01());
			}
			map.put("ltetddprimaryDevice01Id", stationRecord
					.getLtetddprimaryDevice01().getId());
			map.put("ltetddprimaryDevice01Name", stationRecord
					.getLtetddprimaryDevice01().getName());
		} else {
			map.put("ltetddprimaryDevice01Id", null);
			map.put("ltetddprimaryDevice01Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice02()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice02());
			}
			map.put("ltetddprimaryDevice02Id", stationRecord
					.getLtetddprimaryDevice02().getId());
			map.put("ltetddprimaryDevice02Name", stationRecord
					.getLtetddprimaryDevice02().getName());
		} else {
			map.put("ltetddprimaryDevice02Id", null);
			map.put("ltetddprimaryDevice02Name", null);
		}
		map.put("ltetddprimaryDevice03",
				stationRecord.getLtetddprimaryDevice03());
		if (null != stationRecord.getLtetddprimaryDevice04()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice04());
			}
			map.put("ltetddprimaryDevice04Id", stationRecord
					.getLtetddprimaryDevice04().getId());
			map.put("ltetddprimaryDevice04Name", stationRecord
					.getLtetddprimaryDevice04().getName());
		} else {
			map.put("ltetddprimaryDevice04Id", null);
			map.put("ltetddprimaryDevice04Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice05()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice05());
			}
			map.put("ltetddprimaryDevice05Id", stationRecord
					.getLtetddprimaryDevice05().getId());
			map.put("ltetddprimaryDevice05Name", stationRecord
					.getLtetddprimaryDevice05().getName());
		} else {
			map.put("ltetddprimaryDevice05Id", null);
			map.put("ltetddprimaryDevice05Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice06()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice06());
			}
			map.put("ltetddprimaryDevice06Id", stationRecord
					.getLtetddprimaryDevice06().getId());
			map.put("ltetddprimaryDevice06Name", stationRecord
					.getLtetddprimaryDevice06().getName());
		} else {
			map.put("ltetddprimaryDevice06Id", null);
			map.put("ltetddprimaryDevice06Name", null);
		}
		map.put("ltetddprimaryDevice07",
				stationRecord.getLtetddprimaryDevice07());
		map.put("ltetddprimaryDevice08",
				stationRecord.getLtetddprimaryDevice08());
		map.put("ltetddprimaryDevice09",
				stationRecord.getLtetddprimaryDevice09());
		map.put("ltetddprimaryDevice10",
				stationRecord.getLtetddprimaryDevice10());
		map.put("ltetddprimaryDevice11",
				stationRecord.getLtetddprimaryDevice11());
		map.put("ltetddprimaryDevice12",
				stationRecord.getLtetddprimaryDevice12());
		if (null != stationRecord.getLtetddprimaryDevice13()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice13());
			}
			map.put("ltetddprimaryDevice13Id", stationRecord
					.getLtetddprimaryDevice13().getId());
			map.put("ltetddprimaryDevice13Name", stationRecord
					.getLtetddprimaryDevice13().getName());
		} else {
			map.put("ltetddprimaryDevice13Id", null);
			map.put("ltetddprimaryDevice13Name", null);
		}
		map.put("ltetddprimaryDevice14",
				stationRecord.getLtetddprimaryDevice14());
		if (null != stationRecord.getLtetddprimaryDevice15()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice15())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice15());
			}
			map.put("ltetddprimaryDevice15Id", stationRecord
					.getLtetddprimaryDevice15().getId());
			map.put("ltetddprimaryDevice15Name", stationRecord
					.getLtetddprimaryDevice15().getName());
		} else {
			map.put("ltetddprimaryDevice15Id", null);
			map.put("ltetddprimaryDevice15Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice16()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice16())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice16());
			}
			map.put("ltetddprimaryDevice16Id", stationRecord
					.getLtetddprimaryDevice16().getId());
			map.put("ltetddprimaryDevice16Name", stationRecord
					.getLtetddprimaryDevice16().getName());
		} else {
			map.put("ltetddprimaryDevice16Id", null);
			map.put("ltetddprimaryDevice16Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice17()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice17());
			}
			map.put("ltetddprimaryDevice17Id", stationRecord
					.getLtetddprimaryDevice17().getId());
			map.put("ltetddprimaryDevice17Name", stationRecord
					.getLtetddprimaryDevice17().getName());
		} else {
			map.put("ltetddprimaryDevice17Id", null);
			map.put("ltetddprimaryDevice17Name", null);
		}
		map.put("ltetddprimaryDevice18",
				stationRecord.getLtetddprimaryDevice18());
		map.put("ltetddprimaryDevice19",
				stationRecord.getLtetddprimaryDevice19());
		map.put("ltetddprimaryDevice20",
				stationRecord.getLtetddprimaryDevice20());
		map.put("ltetddprimaryDevice21",
				stationRecord.getLtetddprimaryDevice21());
		if (null != stationRecord.getLtetddprimaryDevice22()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice22())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice22());
			}
			map.put("ltetddprimaryDevice22Id", stationRecord
					.getLtetddprimaryDevice22().getId());
			map.put("ltetddprimaryDevice22Name", stationRecord
					.getLtetddprimaryDevice22().getName());
		} else {
			map.put("ltetddprimaryDevice22Id", null);
			map.put("ltetddprimaryDevice22Name", null);
		}
		map.put("ltetddprimaryDevice23",
				stationRecord.getLtetddprimaryDevice23());
		map.put("ltetddprimaryDevice24",
				stationRecord.getLtetddprimaryDevice24());
		if (null != stationRecord.getLtetddprimaryDevice25()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice25())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice25());
			}
			map.put("ltetddprimaryDevice25Id", stationRecord
					.getLtetddprimaryDevice25().getId());
			map.put("ltetddprimaryDevice25Name", stationRecord
					.getLtetddprimaryDevice25().getName());
		} else {
			map.put("ltetddprimaryDevice25Id", null);
			map.put("ltetddprimaryDevice25Name", null);
		}
		if (null != stationRecord.getLtetddprimaryDevice26()) {
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice26());
			}
			map.put("ltetddprimaryDevice26Id", stationRecord
					.getLtetddprimaryDevice26().getId());
			map.put("ltetddprimaryDevice26Name", stationRecord
					.getLtetddprimaryDevice26().getName());
		} else {
			map.put("ltetddprimaryDevice26Id", null);
			map.put("ltetddprimaryDevice26Name", null);
		}
		map.put("ltetddprimaryDevice27",
				stationRecord.getLtetddprimaryDevice27());
		if (null != stationRecord.getCantennaFeed01()) {
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed01())) {
				Hibernate.initialize(stationRecord.getCantennaFeed01());
			}
			map.put("cantennaFeed01Id", stationRecord.getCantennaFeed01()
					.getId());
			map.put("cantennaFeed01Name", stationRecord.getCantennaFeed01()
					.getName());
		} else {
			map.put("cantennaFeed01Id", null);
			map.put("cantennaFeed01Name", null);
		}
		if (null != stationRecord.getCantennaFeed02()) {
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed02())) {
				Hibernate.initialize(stationRecord.getCantennaFeed02());
			}
			map.put("cantennaFeed02Id", stationRecord.getCantennaFeed02()
					.getId());
			map.put("cantennaFeed02Name", stationRecord.getCantennaFeed02()
					.getName());
		} else {
			map.put("cantennaFeed02Id", null);
			map.put("cantennaFeed02Name", null);
		}
		map.put("cantennaFeed03", stationRecord.getCantennaFeed03());
		map.put("cantennaFeed04", stationRecord.getCantennaFeed04());
		map.put("cantennaFeed05", stationRecord.getCantennaFeed05());
		map.put("cantennaFeed06", stationRecord.getCantennaFeed06());
		map.put("cantennaFeed07", stationRecord.getCantennaFeed07());
		map.put("cantennaFeed08", stationRecord.getCantennaFeed08());
		map.put("cantennaFeed09", stationRecord.getCantennaFeed09());
		map.put("cantennaFeed10", stationRecord.getCantennaFeed10());
		map.put("cantennaFeed11", stationRecord.getCantennaFeed11());
		map.put("cantennaFeed12", stationRecord.getCantennaFeed12());
		map.put("cantennaFeed13", stationRecord.getCantennaFeed13());
		if (null != stationRecord.getCantennaFeed14()) {
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed14())) {
				Hibernate.initialize(stationRecord.getCantennaFeed14());
			}
			map.put("cantennaFeed14Id", stationRecord.getCantennaFeed14()
					.getId());
			map.put("cantennaFeed14Name", stationRecord.getCantennaFeed14()
					.getName());
		} else {
			map.put("cantennaFeed14Id", null);
			map.put("cantennaFeed14Name", null);
		}
		map.put("cantennaFeed15", stationRecord.getCantennaFeed15());
		map.put("cantennaFeed16", stationRecord.getCantennaFeed16());
		if (null != stationRecord.getLtefddantennaFeed01()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed01())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed01());
			}
			map.put("ltefddantennaFeed01Id", stationRecord
					.getLtefddantennaFeed01().getId());
			map.put("ltefddantennaFeed01Name", stationRecord
					.getLtefddantennaFeed01().getName());
		} else {
			map.put("ltefddantennaFeed01Id", null);
			map.put("ltefddantennaFeed01Name", null);
		}
		if (null != stationRecord.getLtefddantennaFeed02()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed02())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed02());
			}
			map.put("ltefddantennaFeed02Id", stationRecord
					.getLtefddantennaFeed02().getId());
			map.put("ltefddantennaFeed02Name", stationRecord
					.getLtefddantennaFeed02().getName());
		} else {
			map.put("ltefddantennaFeed02Id", null);
			map.put("ltefddantennaFeed02Name", null);
		}
		if (null != stationRecord.getLtefddantennaFeed03()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed03())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed03());
			}
			map.put("ltefddantennaFeed03Id", stationRecord
					.getLtefddantennaFeed03().getId());
			map.put("ltefddantennaFeed03Name", stationRecord
					.getLtefddantennaFeed03().getName());
		} else {
			map.put("ltefddantennaFeed03Id", null);
			map.put("ltefddantennaFeed03Name", null);
		}
		map.put("ltefddantennaFeed04", stationRecord.getLtefddantennaFeed04());
		map.put("ltefddantennaFeed05", stationRecord.getLtefddantennaFeed05());
		map.put("ltefddantennaFeed06", stationRecord.getLtefddantennaFeed06());
		map.put("ltefddantennaFeed07", stationRecord.getLtefddantennaFeed07());
		map.put("ltefddantennaFeed08", stationRecord.getLtefddantennaFeed08());
		map.put("ltefddantennaFeed09", stationRecord.getLtefddantennaFeed09());
		map.put("ltefddantennaFeed10", stationRecord.getLtefddantennaFeed10());
		map.put("ltefddantennaFeed11", stationRecord.getLtefddantennaFeed11());
		map.put("ltefddantennaFeed12", stationRecord.getLtefddantennaFeed12());
		map.put("ltefddantennaFeed13", stationRecord.getLtefddantennaFeed13());
		if (null != stationRecord.getLtefddantennaFeed14()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed14())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed14());
			}
			map.put("ltefddantennaFeed14Id", stationRecord
					.getLtefddantennaFeed14().getId());
			map.put("ltefddantennaFeed14Name", stationRecord
					.getLtefddantennaFeed14().getName());
		} else {
			map.put("ltefddantennaFeed14Id", null);
			map.put("ltefddantennaFeed14Name", null);
		}
		map.put("ltefddantennaFeed15", stationRecord.getLtefddantennaFeed15());
		map.put("ltefddantennaFeed16", stationRecord.getLtefddantennaFeed16());
		if (null != stationRecord.getLtetddantennaFeed01()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed01())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed01());
			}
			map.put("ltetddantennaFeed01Id", stationRecord
					.getLtetddantennaFeed01().getId());
			map.put("ltetddantennaFeed01Name", stationRecord
					.getLtetddantennaFeed01().getName());
		} else {
			map.put("ltetddantennaFeed01Id", null);
			map.put("ltetddantennaFeed01Name", null);
		}
		if (null != stationRecord.getLtetddantennaFeed02()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed02())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed02());
			}
			map.put("ltetddantennaFeed02Id", stationRecord
					.getLtetddantennaFeed02().getId());
			map.put("ltetddantennaFeed02Name", stationRecord
					.getLtetddantennaFeed02().getName());
		} else {
			map.put("ltetddantennaFeed02Id", null);
			map.put("ltetddantennaFeed02Name", null);
		}
		if (null != stationRecord.getLtetddantennaFeed03()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed03())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed03());
			}
			map.put("ltetddantennaFeed03Id", stationRecord
					.getLtetddantennaFeed03().getId());
			map.put("ltetddantennaFeed03Name", stationRecord
					.getLtetddantennaFeed03().getName());
		} else {
			map.put("ltetddantennaFeed03Id", null);
			map.put("ltetddantennaFeed03Name", null);
		}
		map.put("ltetddantennaFeed04", stationRecord.getLtetddantennaFeed04());
		map.put("ltetddantennaFeed05", stationRecord.getLtetddantennaFeed05());
		map.put("ltetddantennaFeed06", stationRecord.getLtetddantennaFeed06());
		map.put("ltetddantennaFeed07", stationRecord.getLtetddantennaFeed07());
		map.put("ltetddantennaFeed08", stationRecord.getLtetddantennaFeed08());
		map.put("ltetddantennaFeed09", stationRecord.getLtetddantennaFeed09());
		map.put("ltetddantennaFeed10", stationRecord.getLtetddantennaFeed10());
		map.put("ltetddantennaFeed11", stationRecord.getLtetddantennaFeed11());
		map.put("ltetddantennaFeed12", stationRecord.getLtetddantennaFeed12());
		map.put("ltetddantennaFeed13", stationRecord.getLtetddantennaFeed13());
		if (null != stationRecord.getLtetddantennaFeed14()) {
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed14())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed14());
			}
			map.put("ltetddantennaFeed14Id", stationRecord
					.getLtetddantennaFeed14().getId());
			map.put("ltetddantennaFeed14Name", stationRecord
					.getLtetddantennaFeed14().getName());
		} else {
			map.put("ltetddantennaFeed14Id", null);
			map.put("ltetddantennaFeed14Name", null);
		}
		map.put("ltetddantennaFeed15", stationRecord.getLtetddantennaFeed15());
		map.put("ltetddantennaFeed16", stationRecord.getLtetddantennaFeed16());
		if (null != stationRecord.getPowerSupply01()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply01())) {
				Hibernate.initialize(stationRecord.getPowerSupply01());
			}
			map.put("powerSupply01Id", stationRecord.getPowerSupply01().getId());
			map.put("powerSupply01Name", stationRecord.getPowerSupply01()
					.getName());
		} else {
			map.put("powerSupply01Id", null);
			map.put("powerSupply01Name", null);
		}
		if (null != stationRecord.getPowerSupply02()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply02())) {
				Hibernate.initialize(stationRecord.getPowerSupply02());
			}
			map.put("powerSupply02Id", stationRecord.getPowerSupply02().getId());
			map.put("powerSupply02Name", stationRecord.getPowerSupply02()
					.getName());
		} else {
			map.put("powerSupply02Id", null);
			map.put("powerSupply02Name", null);
		}
		if (null != stationRecord.getPowerSupply03()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply03())) {
				Hibernate.initialize(stationRecord.getPowerSupply03());
			}
			map.put("powerSupply03Id", stationRecord.getPowerSupply03().getId());
			map.put("powerSupply03Name", stationRecord.getPowerSupply03()
					.getName());
		} else {
			map.put("powerSupply03Id", null);
			map.put("powerSupply03Name", null);
		}
		map.put("powerSupply04", stationRecord.getPowerSupply04());
		map.put("powerSupply05", stationRecord.getPowerSupply05());
		if (null != stationRecord.getPowerSupply06()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply06())) {
				Hibernate.initialize(stationRecord.getPowerSupply06());
			}
			map.put("powerSupply06Id", stationRecord.getPowerSupply06().getId());
			map.put("powerSupply06Name", stationRecord.getPowerSupply06()
					.getName());
		} else {
			map.put("powerSupply06Id", null);
			map.put("powerSupply06Name", null);
		}
		if (null != stationRecord.getPowerSupply07()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply07())) {
				Hibernate.initialize(stationRecord.getPowerSupply07());
			}
			map.put("powerSupply07Id", stationRecord.getPowerSupply07().getId());
			map.put("powerSupply07Name", stationRecord.getPowerSupply07()
					.getName());
		} else {
			map.put("powerSupply07Id", null);
			map.put("powerSupply07Name", null);
		}
		if (null != stationRecord.getPowerSupply08()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply08())) {
				Hibernate.initialize(stationRecord.getPowerSupply08());
			}
			map.put("powerSupply08Id", stationRecord.getPowerSupply08().getId());
			map.put("powerSupply08Name", stationRecord.getPowerSupply08()
					.getName());
		} else {
			map.put("powerSupply08Id", null);
			map.put("powerSupply08Name", null);
		}
		map.put("powerSupply09", stationRecord.getPowerSupply09());
		map.put("powerSupply10", stationRecord.getPowerSupply10());
		map.put("powerSupply11", stationRecord.getPowerSupply11());
		map.put("powerSupply12", stationRecord.getPowerSupply12());
		if (null != stationRecord.getPowerSupply13()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply13())) {
				Hibernate.initialize(stationRecord.getPowerSupply13());
			}
			map.put("powerSupply13Id", stationRecord.getPowerSupply13().getId());
			map.put("powerSupply13Name", stationRecord.getPowerSupply13()
					.getName());
		} else {
			map.put("powerSupply13Id", null);
			map.put("powerSupply13Name", null);
		}
		map.put("powerSupply14", stationRecord.getPowerSupply14());
		map.put("powerSupply15", stationRecord.getPowerSupply15());
		if (null != stationRecord.getPowerSupply16()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply16())) {
				Hibernate.initialize(stationRecord.getPowerSupply16());
			}
			map.put("powerSupply16Id", stationRecord.getPowerSupply16().getId());
			map.put("powerSupply16Name", stationRecord.getPowerSupply16()
					.getName());
		} else {
			map.put("powerSupply16Id", null);
			map.put("powerSupply16Name", null);
		}
		map.put("powerSupply17", stationRecord.getPowerSupply17());
		map.put("powerSupply18", stationRecord.getPowerSupply18());
		map.put("powerSupply19", stationRecord.getPowerSupply19());
		map.put("powerSupply20", stationRecord.getPowerSupply20());
		map.put("powerSupply21", stationRecord.getPowerSupply21());
		map.put("powerSupply22", stationRecord.getPowerSupply22());
		map.put("powerSupply23", stationRecord.getPowerSupply23());
		if (null != stationRecord.getPowerSupply24()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply24())) {
				Hibernate.initialize(stationRecord.getPowerSupply24());
			}
			map.put("powerSupply24Id", stationRecord.getPowerSupply24().getId());
			map.put("powerSupply24Name", stationRecord.getPowerSupply24()
					.getName());
		} else {
			map.put("powerSupply24Id", null);
			map.put("powerSupply24Name", null);
		}
		map.put("powerSupply25", stationRecord.getPowerSupply25());
		map.put("powerSupply26", stationRecord.getPowerSupply26());
		if (null != stationRecord.getPowerSupply27()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply27())) {
				Hibernate.initialize(stationRecord.getPowerSupply27());
			}
			map.put("powerSupply27Id", stationRecord.getPowerSupply27().getId());
			map.put("powerSupply27Name", stationRecord.getPowerSupply27()
					.getName());
		} else {
			map.put("powerSupply27Id", null);
			map.put("powerSupply27Name", null);
		}
		if (null != stationRecord.getPowerSupply28()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply28())) {
				Hibernate.initialize(stationRecord.getPowerSupply28());
			}
			map.put("powerSupply28Id", stationRecord.getPowerSupply28().getId());
			map.put("powerSupply28Name", stationRecord.getPowerSupply28()
					.getName());
		} else {
			map.put("powerSupply28Id", null);
			map.put("powerSupply28Name", null);
		}
		map.put("powerSupply29", stationRecord.getPowerSupply29());
		map.put("powerSupply30", stationRecord.getPowerSupply30());
		if (null != stationRecord.getPowerSupply31()) {
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply31())) {
				Hibernate.initialize(stationRecord.getPowerSupply31());
			}
			map.put("powerSupply31Id", stationRecord.getPowerSupply31().getId());
			map.put("powerSupply31Name", stationRecord.getPowerSupply31()
					.getName());
		} else {
			map.put("powerSupply31Id", null);
			map.put("powerSupply31Name", null);
		}
		map.put("powerSupply32", stationRecord.getPowerSupply32());
		map.put("powerSupply33", stationRecord.getPowerSupply33());
		if (null != stationRecord.getMachineRoom01()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom01())) {
				Hibernate.initialize(stationRecord.getMachineRoom01());
			}
			map.put("machineRoom01Id", stationRecord.getMachineRoom01().getId());
			map.put("machineRoom01Name", stationRecord.getMachineRoom01()
					.getName());
		} else {
			map.put("machineRoom01Id", null);
			map.put("machineRoom01Name", null);
		}
		if (null != stationRecord.getMachineRoom02()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom02())) {
				Hibernate.initialize(stationRecord.getMachineRoom02());
			}
			map.put("machineRoom02Id", stationRecord.getMachineRoom02().getId());
			map.put("machineRoom02Name", stationRecord.getMachineRoom02()
					.getName());
		} else {
			map.put("machineRoom02Id", null);
			map.put("machineRoom02Name", null);
		}
		if (null != stationRecord.getMachineRoom03()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom03())) {
				Hibernate.initialize(stationRecord.getMachineRoom03());
			}
			map.put("machineRoom03Id", stationRecord.getMachineRoom03().getId());
			map.put("machineRoom03Name", stationRecord.getMachineRoom03()
					.getName());
		} else {
			map.put("machineRoom03Id", null);
			map.put("machineRoom03Name", null);
		}
		map.put("machineRoom04", stationRecord.getMachineRoom04());
		map.put("machineRoom05", stationRecord.getMachineRoom05());
		if (null != stationRecord.getMachineRoom06()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom06())) {
				Hibernate.initialize(stationRecord.getMachineRoom06());
			}
			map.put("machineRoom06Id", stationRecord.getMachineRoom06().getId());
			map.put("machineRoom06Name", stationRecord.getMachineRoom06()
					.getName());
		} else {
			map.put("machineRoom06Id", null);
			map.put("machineRoom06Name", null);
		}
		if (null != stationRecord.getMachineRoom07()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom07())) {
				Hibernate.initialize(stationRecord.getMachineRoom07());
			}
			map.put("machineRoom07Id", stationRecord.getMachineRoom07().getId());
			map.put("machineRoom07Name", stationRecord.getMachineRoom07()
					.getName());
		} else {
			map.put("machineRoom07Id", null);
			map.put("machineRoom07Name", null);
		}
		map.put("machineRoom08", stationRecord.getMachineRoom08());
		map.put("machineRoom09", stationRecord.getMachineRoom09());
		map.put("machineRoom10", stationRecord.getMachineRoom10());
		if (null != stationRecord.getMachineRoom11()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom11())) {
				Hibernate.initialize(stationRecord.getMachineRoom11());
			}
			map.put("machineRoom11Id", stationRecord.getMachineRoom11().getId());
			map.put("machineRoom11Name", stationRecord.getMachineRoom11()
					.getName());
		} else {
			map.put("machineRoom11Id", null);
			map.put("machineRoom11Name", null);
		}
		if (null != stationRecord.getMachineRoom12()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom12())) {
				Hibernate.initialize(stationRecord.getMachineRoom12());
			}
			map.put("machineRoom12Id", stationRecord.getMachineRoom12().getId());
			map.put("machineRoom12Name", stationRecord.getMachineRoom12()
					.getName());
		} else {
			map.put("machineRoom12Id", null);
			map.put("machineRoom12Name", null);
		}
		if (null != stationRecord.getMachineRoom13()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom13())) {
				Hibernate.initialize(stationRecord.getMachineRoom13());
			}
			map.put("machineRoom13Id", stationRecord.getMachineRoom13().getId());
			map.put("machineRoom13Name", stationRecord.getMachineRoom13()
					.getName());
		} else {
			map.put("machineRoom13Id", null);
			map.put("machineRoom13Name", null);
		}
		if (null != stationRecord.getMachineRoom14()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom14())) {
				Hibernate.initialize(stationRecord.getMachineRoom14());
			}
			map.put("machineRoom14Id", stationRecord.getMachineRoom14().getId());
			map.put("machineRoom14Name", stationRecord.getMachineRoom14()
					.getName());
		} else {
			map.put("machineRoom14Id", null);
			map.put("machineRoom14Name", null);
		}
		if (null != stationRecord.getMachineRoom15()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom15())) {
				Hibernate.initialize(stationRecord.getMachineRoom15());
			}
			map.put("machineRoom15Id", stationRecord.getMachineRoom15().getId());
			map.put("machineRoom15Name", stationRecord.getMachineRoom15()
					.getName());
		} else {
			map.put("machineRoom15Id", null);
			map.put("machineRoom15Name", null);
		}
		if (null != stationRecord.getMachineRoom16()) {
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom16())) {
				Hibernate.initialize(stationRecord.getMachineRoom16());
			}
			map.put("machineRoom16Id", stationRecord.getMachineRoom16().getId());
			map.put("machineRoom16Name", stationRecord.getMachineRoom16()
					.getName());
		} else {
			map.put("machineRoom16Id", null);
			map.put("machineRoom16Name", null);
		}
		map.put("machineRoom17", stationRecord.getMachineRoom17());
		if (null != stationRecord.getStructuralMast01()) {
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast01())) {
				Hibernate.initialize(stationRecord.getStructuralMast01());
			}
			map.put("structuralMast01Id", stationRecord.getStructuralMast01()
					.getId());
			map.put("structuralMast01Name", stationRecord.getStructuralMast01()
					.getName());
		} else {
			map.put("structuralMast01Id", null);
			map.put("structuralMast01Name", null);
		}
		if (null != stationRecord.getStructuralMast02()) {
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast02())) {
				Hibernate.initialize(stationRecord.getStructuralMast02());
			}
			map.put("structuralMast02Id", stationRecord.getStructuralMast02()
					.getId());
			map.put("structuralMast02Name", stationRecord.getStructuralMast02()
					.getName());
		} else {
			map.put("structuralMast02Id", null);
			map.put("structuralMast02Name", null);
		}
		if (null != stationRecord.getStructuralMast03()) {
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast03())) {
				Hibernate.initialize(stationRecord.getStructuralMast03());
			}
			map.put("structuralMast03Id", stationRecord.getStructuralMast03()
					.getId());
			map.put("structuralMast03Name", stationRecord.getStructuralMast03()
					.getName());
		} else {
			map.put("structuralMast03Id", null);
			map.put("structuralMast03Name", null);
		}
		map.put("structuralMast04", stationRecord.getStructuralMast04());
		map.put("structuralMast05", stationRecord.getStructuralMast05());
		map.put("structuralMast06", stationRecord.getStructuralMast06());
		map.put("structuralMast07", stationRecord.getStructuralMast07());
		map.put("structuralMast08", stationRecord.getStructuralMast08());
		map.put("structuralMast09", stationRecord.getStructuralMast09());
		map.put("structuralMast10", stationRecord.getStructuralMast10());
		map.put("structuralMast11", stationRecord.getStructuralMast11());
		if (null != stationRecord.getStructuralMast12()) {
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast12())) {
				Hibernate.initialize(stationRecord.getStructuralMast12());
			}
			map.put("structuralMast12Id", stationRecord.getStructuralMast12()
					.getId());
			map.put("structuralMast12Name", stationRecord.getStructuralMast12()
					.getName());
		} else {
			map.put("structuralMast12Id", null);
			map.put("structuralMast12Name", null);
		}
		map.put("structuralMast13", stationRecord.getStructuralMast13());
		map.put("structuralMast14", stationRecord.getStructuralMast14());
		map.put("personnel01", stationRecord.getPersonnel01());
		map.put("personnel02", stationRecord.getPersonnel02());
		map.put("personnel03", stationRecord.getPersonnel03());
		map.put("personnel04", stationRecord.getPersonnel04());
		map.put("personnel05", stationRecord.getPersonnel05());
		map.put("personnel06", stationRecord.getPersonnel06());
		map.put("personnel07", stationRecord.getPersonnel07());
		map.put("personnel08", stationRecord.getPersonnel08());
		map.put("personnel09", stationRecord.getPersonnel09());
		map.put("personnel10", stationRecord.getPersonnel10());
		map.put("personnel11", stationRecord.getPersonnel11());
		map.put("personnel12", stationRecord.getPersonnel12());
		map.put("personnel13", stationRecord.getPersonnel13());
		map.put("personnel14", stationRecord.getPersonnel14());
		map.put("personnel15", stationRecord.getPersonnel15());

		return map;
	}

	@Transactional
	public Station getStationMap(String id) {
		Station station = (Station) entityManager.findFirst(
				"from Station t where t.id=?", new Object[] { id });
		if (null != station) {
			if (!Hibernate.isInitialized(station.getCreator())) {
				Hibernate.initialize(station.getCreator());
			}
			if (!Hibernate.isInitialized(station.getDeletor())) {
				Hibernate.initialize(station.getDeletor());
			}
			if (!Hibernate.isInitialized(station.getStationType())) {
				Hibernate.initialize(station.getStationType());
			}
			if (!Hibernate.isInitialized(station.getSiteProperties())) {
				Hibernate.initialize(station.getSiteProperties());
			}
			if (!Hibernate.isInitialized(station.getPropertyOwnership())) {
				Hibernate.initialize(station.getPropertyOwnership());
			}
			if (!Hibernate.isInitialized(station.getAreaType())) {
				Hibernate.initialize(station.getAreaType());
			}
			if (!Hibernate.isInitialized(station.getConstructionModel())) {
				Hibernate.initialize(station.getConstructionModel());
			}
			if (!Hibernate.isInitialized(station.getSiteValid())) {
				Hibernate.initialize(station.getSiteValid());
			}
		}

		if (station.getStationRecord() == null) {
			StationRecord stationRecord = new StationRecord(station);
			entityManager.persist(stationRecord);
			station.setStationRecord(stationRecord);
			entityManager.persist(station);
		}

		return station;
	}

	@Transactional
	public StationRecord getStationRecordByStationId(String stationId) {
		StationRecord stationRecord = (StationRecord) entityManager.findFirst(
				"from StationRecord t where t.station.id=?",
				new Object[] { stationId });
		return getStationRecordMap(stationRecord);
	}

	@Transactional
	public StationRecord getStationRecordById(String id) {
		StationRecord stationRecord = (StationRecord) entityManager.findFirst(
				"from StationRecord t where t.id=?", new Object[] { id });
		return getStationRecordMap(stationRecord);
	}

	private StationRecord getStationRecordMap(StationRecord stationRecord) {
		if (null != stationRecord) {
			if (!Hibernate.isInitialized(stationRecord.getStation())) {
				Hibernate.initialize(stationRecord.getStation());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice01());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice02());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice03())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice03());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice04());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice05());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice06());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice07())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice07());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice08())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice08());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice09())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice09());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice13());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice17());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice18())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice18());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice19())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice19());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice20())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice20());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice21())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice21());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice22())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice22());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice26());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice31())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice31());
			}
			if (!Hibernate.isInitialized(stationRecord.getCprimaryDevice32())) {
				Hibernate.initialize(stationRecord.getCprimaryDevice32());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice01());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice02());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice04());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice05());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice06());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice13());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice14())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice14());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice15())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice15());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice16())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice16());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice17());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice23())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice23());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice25())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice25());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtefddprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getLtefddprimaryDevice26());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice01())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice01());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice02())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice02());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice04())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice04());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice05())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice05());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice06())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice06());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice13())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice13());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice15())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice15());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice16())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice16());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice17())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice17());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice22())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice22());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice25())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice25());
			}
			if (!Hibernate.isInitialized(stationRecord
					.getLtetddprimaryDevice26())) {
				Hibernate.initialize(stationRecord.getLtetddprimaryDevice26());
			}
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed01())) {
				Hibernate.initialize(stationRecord.getCantennaFeed01());
			}
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed02())) {
				Hibernate.initialize(stationRecord.getCantennaFeed02());
			}
			if (!Hibernate.isInitialized(stationRecord.getCantennaFeed14())) {
				Hibernate.initialize(stationRecord.getCantennaFeed14());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed01())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed01());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed02())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed02());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed03())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed03());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtefddantennaFeed14())) {
				Hibernate.initialize(stationRecord.getLtefddantennaFeed14());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed01())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed01());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed02())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed02());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed03())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed03());
			}
			if (!Hibernate
					.isInitialized(stationRecord.getLtetddantennaFeed14())) {
				Hibernate.initialize(stationRecord.getLtetddantennaFeed14());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply01())) {
				Hibernate.initialize(stationRecord.getPowerSupply01());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply02())) {
				Hibernate.initialize(stationRecord.getPowerSupply02());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply03())) {
				Hibernate.initialize(stationRecord.getPowerSupply03());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply06())) {
				Hibernate.initialize(stationRecord.getPowerSupply06());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply07())) {
				Hibernate.initialize(stationRecord.getPowerSupply07());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply08())) {
				Hibernate.initialize(stationRecord.getPowerSupply08());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply13())) {
				Hibernate.initialize(stationRecord.getPowerSupply13());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply16())) {
				Hibernate.initialize(stationRecord.getPowerSupply16());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply24())) {
				Hibernate.initialize(stationRecord.getPowerSupply24());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply27())) {
				Hibernate.initialize(stationRecord.getPowerSupply27());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply28())) {
				Hibernate.initialize(stationRecord.getPowerSupply28());
			}
			if (!Hibernate.isInitialized(stationRecord.getPowerSupply31())) {
				Hibernate.initialize(stationRecord.getPowerSupply31());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom01())) {
				Hibernate.initialize(stationRecord.getMachineRoom01());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom02())) {
				Hibernate.initialize(stationRecord.getMachineRoom02());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom03())) {
				Hibernate.initialize(stationRecord.getMachineRoom03());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom06())) {
				Hibernate.initialize(stationRecord.getMachineRoom06());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom07())) {
				Hibernate.initialize(stationRecord.getMachineRoom07());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom11())) {
				Hibernate.initialize(stationRecord.getMachineRoom11());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom12())) {
				Hibernate.initialize(stationRecord.getMachineRoom12());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom13())) {
				Hibernate.initialize(stationRecord.getMachineRoom13());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom14())) {
				Hibernate.initialize(stationRecord.getMachineRoom14());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom15())) {
				Hibernate.initialize(stationRecord.getMachineRoom15());
			}
			if (!Hibernate.isInitialized(stationRecord.getMachineRoom16())) {
				Hibernate.initialize(stationRecord.getMachineRoom16());
			}
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast01())) {
				Hibernate.initialize(stationRecord.getStructuralMast01());
			}
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast02())) {
				Hibernate.initialize(stationRecord.getStructuralMast02());
			}
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast03())) {
				Hibernate.initialize(stationRecord.getStructuralMast03());
			}
			if (!Hibernate.isInitialized(stationRecord.getStructuralMast12())) {
				Hibernate.initialize(stationRecord.getStructuralMast12());
			}
		}
		return stationRecord;
	}
}
